<?php
   /*
        $Id: mpay24_select.php,v 1.24 2009/07/08 09:11:35 thomas Exp $

        Code by Wolfgang Schaefer wolfgang.schaefer@mPAY24.com
        Code by Thomas Langer Thomas.Langer@mPAY24.com
        Company mPAY24 GmbH
        https://www.mPAY24.com
        Released under the GNU General Public License
   */
   class mpay24_select {

      // class constructor
      function mpay24_select() {
         global $order;
         $this->code = 'mpay24_select';
         $this->title = MODULE_PAYMENT_MPAY24_SELECT_TEXT_TITLE;
         $this->description = MODULE_PAYMENT_MPAY24_SELECT_TEXT_DESCRIPTION;
         $this->sort_order = MODULE_PAYMENT_MPAY24_SELECT_SORT_ORDER;
         $this->enabled = ((MODULE_PAYMENT_MPAY24_SELECT_STATUS == 'True') ? true : false);
         $this->merchantid = MODULE_PAYMENT_MPAY24_SELECT_MERCHANTID;
         if ((int)MODULE_PAYMENT_MPAY24_SELECT_ORDER_STATUS_ID > 0) {
            $this->order_status = MODULE_PAYMENT_MPAY24_SELECT_ORDER_STATUS_ID;
         }
         if (is_object($order)) {
            $this->update_status();
         }
      }

      // class methods
      function update_status() {
         global $order;
         if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MPAY24_SELECT_ZONE > 0) ) {
            $check_flag = false;
            $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES .
               " where geo_zone_id = '" . MODULE_PAYMENT_MPAY24_SELECT_ZONE .
               "' and zone_country_id = '" . $order->billing['country']['id'] .
               "' order by zone_id");
            while ($check = xtc_db_fetch_array($check_query)) {
               if ($check['zone_id'] < 1) {
                  $check_flag = true;
                  break;
               } elseif ($check['zone_id'] == $order->billing['zone_id']) {
                  $check_flag = true;
                  break;
               }
            }
            if ($check_flag == false) { $this->enabled = false; }
         }
      }

      function javascript_validation() {
         return false;
      }

      function selection() {
         $mpay24_misc;
         $mpay24_info;

         // Creditcards and Maestro SecureCode
         if (MODULE_PAYMENT_MPAY24_SELECT_AMEX == "akzeptieren") {
            $mpay24_cc .= "<img src=images/AMEX_tmpl.gif alt='American Express Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_DINERS == "akzeptieren") {
            $mpay24_cc .= "<img src=images/DINERS_tmpl.gif alt='Diners Club Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_JCB == "akzeptieren") {
            $mpay24_cc .= "<img src=images/JCB_tmpl.gif alt='JCB Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         switch(MODULE_PAYMENT_MPAY24_SELECT_MASTERCARD) {
            case "MasterCard SecureCode":
               if (MODULE_PAYMENT_MPAY24_SELECT_MAESTRO == "akzeptieren") {
                  $mpay24_cc .= "<img src=images/MASTERCARDSC_tmpl.gif alt='MasterCard SecureCode'><img src=images/MAESTRO_tmpl.gif alt='Maestro SecureCode'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               } else {
                  $mpay24_cc .= "<img src=images/MASTERCARDSC_tmpl.gif alt='MasterCard SecureCode'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               }
               break;
            case "MasterCard ohne MasterCard SecureCode":
               $mpay24_cc .= "<img src=images/MASTERCARD_tmpl.gif alt='MasterCard'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               if (MODULE_PAYMENT_MPAY24_SELECT_MAESTRO == "akzeptieren")
                  $mpay24_cc .= "<img src=images/MAESTROMCSC_tmpl.gif alt='Maestro SecureCode'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               break;
            default:
               if (MODULE_PAYMENT_MPAY24_SELECT_MAESTRO == "akzeptieren")
                  $mpay24_cc .= "<img src=images/MAESTROMCSC_tmpl.gif alt='Maestro SecureCode'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               break;
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_VISA == "Verified by VISA") {
            $mpay24_cc .= "<img src=images/VISAVBV_tmpl.gif  alt='Verified by VISA'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         } elseif (MODULE_PAYMENT_MPAY24_SELECT_VISA == "VISA ohne Verified by VISA") {
            $mpay24_cc .= "<img src=images/VISA_tmpl.gif alt='VISA'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         
         // EPS Online-Ueberweisung
         if (MODULE_PAYMENT_MPAY24_SELECT_EPS == "akzeptieren") {
            $mpay24_epslogos .= "<img src=images/EPS_tmpl.gif alt='EPS Online-Ueberweisung Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
	    $mpay24_epstypes = split(",", MODULE_PAYMENT_MPAY24_SELECT_EPSTYPES);
            if (count($mpay24_epstypes)>1) {
               for($i=0;$i<count($mpay24_epstypes);$i++) {
                  $mpay24_epslogos .= "<img src=images/" . $mpay24_epstypes[$i] . "_tmpl.gif alt='".$mpay24_epstypes[$i]." Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
               }
            }
         }
         
         // Other Methods
         if (MODULE_PAYMENT_MPAY24_SELECT_GIROPAY == "akzeptieren"){
         	$mpay24_misc .= "<img src=\"images/GIROPAY_tmpl.gif\" alt=\"giropay Logo\">" . xtc_draw_separator('pixel_trans.gif','5','1');
         }
         
         if (MODULE_PAYMENT_MPAY24_SELECT_QUICK == "akzeptieren") {
            $mpay24_misc .= "<img src=images/QUICK_tmpl.gif alt='@Quick Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_PB == "akzeptieren") {
            $mpay24_misc .= "<img src=images/PB_tmpl.gif alt='paybox Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_PSC == "akzeptieren") {
            $mpay24_misc .= "<img src=images/PSC_tmpl.gif alt='paysafecard Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_ONE == "akzeptieren") {
            $mpay24_misc .= "<img src=images/ONE_tmpl.gif alt='ONE Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         if (MODULE_PAYMENT_MPAY24_SELECT_TMOBILE == "akzeptieren") {
            $mpay24_misc .= "<img src=images/TMOBILE_tmpl.gif alt='T-Mobile Logo'>" . xtc_draw_separator('pixel_trans.gif', '5', '1');
         }
         switch(MODULE_PAYMENT_MPAY24_SELECT_ELV){
         	case "ATOS":
         		$mpay24_misc .= "<p><img src=\"images/ATOS_tmpl.gif\" alt=\"ATOS Logo\" style=\"vertical-align:middle;\"/>" . MODULE_PAYMENT_MPAY24_SELECT_TEXT_ELV . "</p>";
         		break;
         	case "HOBEX":
         		$mpay24_misc .= "<p><img src=\"images/HOBEX_tmpl.gif\" alt='HOBEX Logo' style='vertical-align:middle;'/> " . MODULE_PAYMENT_MPAY24_SELECT_TEXT_ELV . "</p>";
         		break;
         	default:
         		// do nothing
         }
         
         if ($_SESSION['customers_status']['customers_status_id'] == 0 && MODULE_PAYMENT_MPAY24_SELECT_TEST == "True"){
            $mpay24_info  = "<p><ul>";
            $mpay24_info .= "<li><input type=\"radio\" name=\"www\" value=\"test\"/> test.mPAY24.com</li>";
            $mpay24_info .= "<li><input type=\"radio\" name=\"www\" value=\"www\" checked=\"checked\"/> www.mPAY24.com</li>";
            $mpay24_info .= "</ul></p>";
         }
         
         $mpay24_info .= "<a href='https://www.mPAY24.com' target='about:blank'><img src=images/mp24logo_s.gif alt='mPAY24 Logo' style='float:left; margin-right:20px; margin-bottom:10px; border:none'></a>" . MODULE_PAYMENT_MPAY24_SELECT_TEXT_INFO;
         $selection = array('id' => $this->code,
            'module' => $this->description,
            'fields' => array(array('title' => $mpay24_info),
               array('title' => $mpay24_cc),
               array('title' => $mpay24_misc),
               array('title' => $mpay24_epslogos)));
         return $selection;
      }

      function pre_confirmation_check() {
         global $order, $language, $order_total_modules;
         
         
         
         return false;
      }

      function confirmation() {
         global $order, $language, $order_total_modules;
         include(DIR_WS_CLASSES . 'mpay24_srequest.php');
         
         $etp_url = "https://";
         
         if(MODULE_PAYMENT_MPAY24_SELECT_TEST == "True" && $_POST["www"] == "test"){
            $etp_url .= "test";
            $MERCHANTID = MODULE_PAYMENT_MPAY24_SELECT_TEST_MERCHANTID;
         }else{
            $etp_url .= "www";
            $MERCHANTID = MODULE_PAYMENT_MPAY24_SELECT_MERCHANTID;
         }
         $etp_url .= ".mPAY24.com/app/bin/etpv5";
         $this->request = new mpay24_srequest($etp_url);
         $billing_addr = new mpay24_address();
         $style = new mpay24_style();
         $items = array();

         // set all parameters for request
         $this->request->setMerchantID($MERCHANTID);
         $this->request->setTID("");
         $this->request->setTemplateSet("WEB");
         $this->request->setLanguage($language);
         
         if(!empty($_GET["XTCsid"]))
         	$UserField = $_GET["XTCsid"];
         elseif(!empty($_COOKIE["XTCsid"]))
         	$UserField = $_COOKIE['XTCsid'];
         else
         	$UserField = $_SESSION['XTCsid'];
         $this->request->setUserField($UserField);
         $this->request->setDescription("Bestellung bei " . TITLE);         

         // set Billing Address
         $billing_addr->setFirstName($order->billing['firstname']);
         $billing_addr->setLastName($order->billing['lastname']);
         $billing_addr->setStreet($order->billing['street_address']);
         $billing_addr->setZip($order->billing['postcode']);
         $billing_addr->setCity($order->billing['city']);
         $billing_addr->setCountry($order->billing['country']['title']);
         $billing_addr->setEmail($order->customer['email_address']);
         $this->request->setBillingAddress($billing_addr);
         
         // set the Payment Window Style attributes
         $style->setLogoStyle(MODULE_PAYMENT_MPAY24_SELECT_LOGOSTYLE);
         $style->setPageHeaderStyle(MODULE_PAYMENT_MPAY24_SELECT_PAGEHEADERSTYLE);
         $style->setPageCaptionStyle(MODULE_PAYMENT_MPAY24_SELECT_PAGECAPTIONSTYLE);
         $style->setPageStyle(MODULE_PAYMENT_MPAY24_SELECT_PAGESTYLE);
         $style->setFooterStyle(MODULE_PAYMENT_MPAY24_SELECT_FOOTERSTYLE);
         $style->setSCStyle(MODULE_PAYMENT_MPAY24_SELECT_SCSTYLE);
         $style->setSCHeaderStyle(MODULE_PAYMENT_MPAY24_SELECT_SCHEADERSTYLE);
         $style->setSCCaptionStyle(MODULE_PAYMENT_MPAY24_SELECT_SCCAPTIONSTYLE);
         $style->setSCNumberStyle(MODULE_PAYMENT_MPAY24_SELECT_SCNUMBERSTYLE);
         $style->setSCDescriptionStyle(MODULE_PAYMENT_MPAY24_SELECT_SCDESCRIPTIONSTYLE);
         $style->setSCQuantityStyle(MODULE_PAYMENT_MPAY24_SELECT_SCQUANTITYSTYLE);
         $style->setSCPriceStyle(MODULE_PAYMENT_MPAY24_SELECT_SCPRICESTYLE);     
         $style->setSCItemEvenStyle(MODULE_PAYMENT_MPAY24_SELECT_SCITEMEVENSTYLE);
         $style->setSCItemOddStyle(MODULE_PAYMENT_MPAY24_SELECT_SCITEMODDSTYLE);
         $style->setShippingCostsHStyle(MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSHSTYLE);
         $style->setShippingCostsStyle(MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSSTYLE);
         $style->setTaxHStyle(MODULE_PAYMENT_MPAY24_SELECT_TAXHSTYLE);
         $style->setTaxStyle(MODULE_PAYMENT_MPAY24_SELECT_TAXSTYLE);
         $style->setPRHeader(MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADER);
         $style->setPRHeaderStyle(MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADERSTYLE);
         $style->setPRStyle(MODULE_PAYMENT_MPAY24_SELECT_PRICESTYLE);
         $this->request->setStyle($style);
         
         if(ENABLE_SSL === true)
         	$url = HTTPS_SERVER;
         else
         	$url = HTTP_SERVER;         
         $url = $url . DIR_WS_CATALOG;
         $this->request->setSuccessURL($url . "redirect_mpay24.php?SUCCESS=TRUE");
         $this->request->setErrorURL($url . "redirect_mpay24.php?SUCCESS=FALSE");
         $this->request->setConfirmURL($url . "mpay24_confirm.php?XTCsid=" . $UserField);
         
         $DECIMAL_POINT = ".";

         // set itemlist
         for($i = 0; $i < count($order->products); $i++) {
            $items[$i] = new mpay24_item();
            $items[$i]->SetNumber($i + 1);
            $items[$i]->setDescription($order->products[$i]['name']);
            $items[$i]->setQuantity($order->products[$i]['qty']);

            // read decimal_separator from database
            $query = xtc_db_query("SELECT decimal_point FROM currencies WHERE code = '" . $order->info['currency'] . "'");
            $result = xtc_db_fetch_array($query); 
            
            // check if there is a entry in info->['currency_value']
            if(empty($order->info['currency_value'])) {
               $items[$i]->setPrice(number_format($order->products[$i]['final_price'], 2, $DECIMAL_POINT, ''));
            } else {
               $items[$i]->setPrice(number_format($order->products[$i]['final_price'] * $order->info['currency_value'], 2, $DECIMAL_POINT, '' ));
            }
            $this->request->addItem($items[$i]);
         }
         
         // set the other payment related values, like shipping costs, tax, ...
         // we try to read everything from the order_total plugin...
         if(empty($order_total_modules)) {
            if(empty($order->info['currency_value'])) {
               $this->request->setTotalPrice(number_format($order->info['total'], 2, $DECIMAL_POINT, ''));
            } else {
               $this->request->setTotalPrice(number_format($order->info['total'] * $order->info['currency_value'], 2, $DECIMAL_POINT, ''));
            }
         } else {
            for($i = 0; $i < count($order_total_modules->modules); $i++) {
               $otname     = trim($order_total_modules->modules[$i], ".php");
               global $$otname;
               $otplugin   = array();
               $otplugin   = $$otname;
               /* Output for debugging *
               * echo "<p>";
               * print_r($otplugin);
               * echo "</p>";
               */
               if($otplugin->enabled == 1 && ($otplugin->code != 'ot_tax' && $otplugin->code != 'ot_total')) {
                  /* Output for debugging *
                  * echo "<p>code: ";
                  * print_r($otplugin->code);
                  * echo "&nbsp;enabled: ";
                  * print_r($otplugin->enabled);
                  * echo "</p>";
                  */
                  for($n = 0; $n < count($otplugin->output); $n++) {
                     /* Output for debugging *
                     * echo "<p>otplugin>output: ";
                     * print_r($otplugin->output);
                     * echo "</p>";
                     * echo "otplugin>output>title: " . $otplugin->output[$n]['title'] . "<br/>";
                     * echo "otplugin>output>value: " . $otplugin->output[$n]['value'] . "<br/>";
                     */
                     $header_value = array();
                     array_push($header_value, $otplugin->output[$n]['title'], number_format($otplugin->output[$n]['value'], 2, $DECIMAL_POINT, ''));
                     /* Output for debugging *
                     * echo "<p>header_value: ";
                     * print_r($header_value);
                     * echo "</p>";
                     */
                     if($header_value[1] > 0)
                        $this->request->addShippingCosts($header_value);
                  }
               }
               elseif($otplugin->enabled == 1 && $otplugin->code == 'ot_tax') {
                  /* Output for debugging *
                  * echo "<p>code: ";
                  * print_r($otplugin->code);
                  * echo "&nbsp;enabled: ";
                  * print_r($otplugin->enabled);
                  * echo "</p>";
                  */
                  for($n = 0; $n < count($otplugin->output); $n++) {
                     /* Output for debugging *
                     * echo "<p>otplugin>output: ";
                     * print_r($otplugin->output);
                     * echo "</p>";
                     * echo "otplugin>output>title: " . $otplugin->output[$n]['title'] . "<br/>";
                     * echo "otplugin>output>value: " . $otplugin->output[$n]['value'] . "<br/>";
                     */
                     $header_value = array();
                     array_push($header_value, $otplugin->output[$n]['title'], number_format($otplugin->output[$n]['value'], 2, $DECIMAL_POINT, ''));
                     /* Output for debugging *
                     * echo "<p>header_value: ";
                     * print_r($header_value);
                     * echo "</p>";
                     */
                     if($header_value[1] > 0)
                        $this->request->addTax($header_value);
                  }
               }
               elseif($otplugin->enabled == 1 && $otplugin->code == 'ot_total') {
                  /* Output for debugging *
                  * echo "<p>code: ";
                  * print_r($otplugin->code);
                  * echo "&nbsp;enabled: ";
                  * print_r($otplugin->enabled);
                  * echo "</p>";
                  * echo "<p>otplugin>output: ";
                  * print_r($otplugin->output);
                  * echo "</p>";
                  */
                  $this->request->setTotalPrice(number_format($otplugin->output[0]['value'], 2, $DECIMAL_POINT, ''));
               }
            }
         }
         
         // set the chosen currency
         $this->request->setCurrency($order->info['currency']);

         // check if the selected paymenttypes in the shop are also to be considered for the paymentwindow
         $query = xtc_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION .
            " WHERE configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_PTYPESFORWMBI';");
         $result = xtc_db_fetch_array($query);
         if($result['configuration_value'] == 'True') {
            $query = xtc_db_query("SELECT configuration_key,configuration_value FROM " . TABLE_CONFIGURATION . " WHERE "
               . " configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_AMEX' "
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_DINERS'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_JCB'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_MASTERCARD'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_VISA'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_MAESTRO'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_GIROPAY'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_PSC'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_PB'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_EPS'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_QUICK'"
               . "OR configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_ELV'");
            while($result = xtc_db_fetch_array($query)) {
               switch($result['configuration_key']) {
                  case 'MODULE_PAYMENT_MPAY24_SELECT_AMEX':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("CC,AMEX");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_DINERS':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("CC,DINERS");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_JCB':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("CC,JCB");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_MASTERCARD':
                     if($result['configuration_value'] == "MasterCard SecureCode" || $result['configuration_value'] == "MasterCard ohne MasterCard SecureCode") {
                        $this->request->addPaymentType("CC,MASTERCARD");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_VISA':
                     if($result['configuration_value'] == "Verified by VISA" || $result['configuration_value'] == "VISA ohne Verified by VISA") {
                        $this->request->addPaymentType("CC,VISA");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_MAESTRO':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("MAESTRO");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_GIROPAY':
                  	if($result['configuration_value'] == "akzeptieren"){
                  		$this->request->addPaymentType("GIROPAY");
                  	}
                  	break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_PSC':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("PSC");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_PB':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("PB");
                        $this->request->addPaymentType("MIA");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_EPS':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("EPS");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_QUICK':
                     if($result['configuration_value'] == "akzeptieren") {
                        $this->request->addPaymentType("QUICK");
                     }
                     break;
                  case 'MODULE_PAYMENT_MPAY24_SELECT_ELV':
                     if($result['configuration_value'] == "ATOS" || $result['configuration_value'] == "HOBEX") {
                        $this->request->addPaymentType("ELV");
                     }
                     break;
               }
            }
         }

         // create XMLFILE
         $this->request->createXMLFile();
		 
         // obsolete, only necessary when XML stream is stored in file system
         #$this->request->setXMLDir(MODULE_PAYMENT_MPAY24_SELECT_XMLDIR);
         #$this->request->saveXMLFile();
         
         // for debugging purposes
         #echo $this->request->getXmlFile();
         
         // save the tid in the mpay24_select table
         $this->request->send();
         $this->request->parseResponse();
         $STATUS = $this->request->getSTATUS();
         if($STATUS != "OK") { 
            $messageStack = new messageStack; 
            $messageStack->add('header', 'RETURNCODE: ' . $this->request->getRETURNCODE(), 'warning'); 
            $this->form_action_url = MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE;
            echo $messageStack->output('header');
         }else{
            $this->form_action_url = $url . $this->request->getFormActionUrl();
         }
         
         xtc_db_query("insert into mpay24_select (tid, price, currency, timestamp, url) values(" . "'" . $this->request->getTid() . "','" . $this->request->getTotalPrice() . "','" . $this->request->getCurrency() . "','" . date("YmdHis") . "','" . $this->request->getLocation() . "')");
         $this->tid = $this->request->getTid(); 
         // for debugging purposes
         #print_r($order);
         return false;
      }

      function process_button() {
         global $order;
         $process_button_string = xtc_draw_hidden_field('TID', $this->tid);
         return $process_button_string;
      }

      function before_process() {
         global $order, $language;
         // read the Tid from the Get-Request
         $tid = $_GET['TID'];
         $timeout = 20; // timeout of 20 seconds
         $count = 1;    // count the seconds

         // check if tid contains invalid characters
         if(ereg('[^A-Za-z0-9]', $tid)) {
            openlog("", LOG_PID | LOG_PERROR, LOG_LOCAL0);
            syslog(LOG_WARNING, "TID '$tid' contains invalid Characters!");
            syslog(LOG_WARNING, "Aborting...");
            closelog();
            xtc_redirect(MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE);
            exit(1);
         }

         // pruefe ob die confirmation_url schon aufgerufen wurde
         // um zu entscheiden, ob eine Bestellung generiert werden soll
         // oder nicht
         $query = xtc_db_query("select status from mpay24_select where tid = '" . $tid . "'");
         $result = xtc_db_fetch_array($query);
         while($count <= $timeout && $result['status'] == 'ERROR') {
            $query = xtc_db_query("select status from mpay24_select where tid = '" . $tid . "'");
            $result = xtc_db_fetch_array($query);
            sleep(1);
            $count++;
         }
         switch($result['status']) {
            case 'RESERVED':
               $this->tid = $tid;
               break;
            case 'BILLED':
               $this->tid = $tid;
               break;
            case 'ERROR':
               xtc_redirect(MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE);
               break;
            default:
               xtc_redirect(MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE);
         }
      }

      function after_process() {
         global $order, $language, $insert_id;
         $this->tid = $_GET['TID'];
         $tim = date("Y-m-d H:i:s", time());
         $query = xtc_db_query("select mpay24tid, brand, status from mpay24_select where tid = '" . $this->tid . "'");
         $result = xtc_db_fetch_array($query);

         // Bestellung ist generiert worden
         // verknuepfe order_id mit TID
         xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " set comments = '" . "mPAY24TID: " . $result['mpay24tid'] . "', customer_notified = '" . $customer_notification . "', date_added = '" . $tim . "', orders_status_id = '" . $order->info['order_status'] . "', orders_id = " . $insert_id);
         xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " set comments = '" . "Zahlungsart: " . $result['brand'] . "', customer_notified = '" . $customer_notification . "', date_added = '" . $tim . "', orders_status_id = '" . $order->info['order_status'] . "', orders_id = " . $insert_id);
         xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " set comments = '" . "Status: " . $result['status'] . "', customer_notified = '" . $customer_notification . "', date_added = '" . $tim . "', orders_status_id = '" . $order->info['order_status'] . "', orders_id = " . $insert_id);
         return false;
      }

      function output_error() {
         return false;
      }

      function get_error() {
         global $HTTP_GET_VARS;
         $error = array('title' => MODULE_PAYMENT_MPAY24_SELECT_TEXT_ERROR, 'error' => MODULE_PAYMENT_MPAY24_SELECT_TEXT_ERROR);
         return $error;
      }

      function check() {
         if (!isset($this->_check)) {
            $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_MPAY24_SELECT_STATUS'");
            $this->_check = xtc_db_num_rows($check_query);
         }
         return $this->_check;
      }

      function install() {
      
         // mpay24_select
         xtc_db_query("CREATE TABLE IF NOT EXISTS mpay24_select("                                                 .
            " id bigint( 11 ) NOT NULL AUTO_INCREMENT ,"                                                          .
            " tid varchar( 32 ) NOT NULL default '',"                                                             .
            " mpay24tid bigint( 11 ) default NULL ,"                                                              .
            " price bigint( 10 ) NOT NULL default '0',"                                                           .
            " currency char( 3 ) NOT NULL default '',"                                                            .
            " `timestamp` timestamp( 14 ) NOT NULL ,"                                                             .
            " `status` enum( 'RESERVED', 'BILLED', 'REVERSED', 'CREDITED', 'ERROR' ) NOT NULL default 'ERROR',"   .
            " brand varchar( 10 ) NULL ,"                                                                         .
            " url text NULL ,"                                                                                    .
            " PRIMARY KEY ( id )"                                                                                 .
            " ) TYPE = MYISAM AUTO_INCREMENT =1;");
         
         if(class_exists("SoapClient")){
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PASSWORD', '6', '0', NOW())");
            xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_TEST_PASSWORD', '6', '0', NOW())");
         }
         
         // MerchantID
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_MERCHANTID', '6', '0', NOW())");
         
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_TEST', 'True', '6', '0', NOW(), 'xtc_cfg_select_option(array(\'True\', \'False\'),')");
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_TEST_MERCHANTID', '6', '0', NOW())");
         
         // Enable Module
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_STATUS', 'True', '6', '0', NOW(), 'xtc_cfg_select_option(array(\'True\', \'False\'),')");
         
         // Standardw?hrung
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_CURRENCY', 'Selected Currency', '6', '0', NOW(), 'xtc_cfg_select_option(array(\'Selected Currency\',\'Only EUR\',\'Only USD\',\'Only GBP\',\'Only CHF\'),')");
         
         // Standardbestellstatus
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_ORDER_STATUS_ID', '0', '6', '0', NOW(), 'xtc_get_order_status_name', 'xtc_cfg_pull_down_order_statuses(')");
         
         // Erlaubte Zonen
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_ALLOWED', '6', '0', NOW())");
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_ZONE', '0', '6', '0', NOW(), 'xtc_get_zone_class_title', 'xtc_cfg_pull_down_zone_classes(')");
         
         // Reihung in der Anzeige
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SORT_ORDER', '0', '6', '0', NOW())");
         
         // OBSOLETE GetData-URL
         #xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_XMLDIR', '/home/apache2/htdocs/temp', '6', '0', NOW())");
         
         // Error-URL
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE', 'http://www.your-shop.domain/errorpage.php', '6', '0', NOW())");
         
         // CSS Paymentwindow Logo Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_LOGOSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Header Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCHEADERSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart First Line Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCCAPTIONSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Incremental Number Colmn Header
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCNUMBERSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Description Column Header
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCDESCRIPTIONSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Quantity Column Header
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCQUANTITYSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Price Column Header
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCPRICESTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Even Lines
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCITEMEVENSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shopping Cart Odd Lines
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SCITEMODDSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shipping Costs Label Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSHSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Shipping Costs Value Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Tax Label Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_TAXHSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Tax Value Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_TAXSTYLE', '6', '1', NOW())");
         
         // Paymentwindow 'All Round Price' Label
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADER', '6', '1', NOW())");
         
         // CSS Paymentwindow 'All Round Price' Label
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADERSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow 'All Round Price' Value
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PRICESTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Page Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PAGESTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Page Header
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PAGEHEADERSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Page First Line Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PAGECAPTIONSTYLE', '6', '1', NOW())");
         
         // CSS Paymentwindow Footer Area
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_FOOTERSTYLE', '6', '1', NOW())");
         
         // Nur hier gew�hlte Zahlungsmittel auch im Bezahlfenster anzeigen?
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PTYPESFORWMBI', 'False', '6', '0', NOW(), 'xtc_cfg_select_option(array(\'True\', \'False\'),')");
         
         // Zahlungsmittel AMEX
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_AMEX', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel DINERS
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_DINERS', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel JCB
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_JCB', 'akzeptieren','6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel MASTERCARD SECURECODE
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_MASTERCARD', 'MasterCard SecureCode','6', '3', NOW(), 'xtc_cfg_select_option(array(\'MasterCard SecureCode\', \'MasterCard ohne MasterCard SecureCode\', \'keine MasterCard Zahlungen akzeptieren\'),')");
         
         // Zahlungsmittel VERIFIED BY VISA
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_VISA', 'Verified by VISA', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'Verified by VISA\', \'VISA ohne Verified by VISA\', \'keine VISA-Zahlungen akzeptieren\'),')");
         
         // Zahlungsmittel MAESTRO SECURECODE
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_MAESTRO', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel EPS
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_EPS', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel EPS Banklogos
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_EPSTYPES', 'BA,BAWAGPSK,ERSTE,HYPO,RZB,ARZ','6', '3', NOW())");
         
         // Zahlungsmittel giropay
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_GIROPAY', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel PAYSAFECARD
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PSC', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel PAYBOX
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_PB', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel @QUICK
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_QUICK', 'akzeptieren', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'akzeptieren\', \'nicht akzeptieren\'),')");
         
         // Zahlungsmittel ELV
         xtc_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_key, configuration_value,  configuration_group_id, sort_order, date_added, set_function) VALUES ('MODULE_PAYMENT_MPAY24_SELECT_ELV', 'ATOS', '6', '3', NOW(), 'xtc_cfg_select_option(array(\'nicht akzeptieren\', \'ATOS\', \'HOBEX\'),')");
      }

      function remove() {
         xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
         xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('MODULE_PAYMENT_MPAY24_SELECT_FOOTERSTYLE')");
         xtc_db_query("drop table mpay24_select");
      }

      function keys() {
         $attributes = array();
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_MERCHANTID');
         if(class_exists("SoapClient"))
            array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PASSWORD');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_TEST');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_TEST_MERCHANTID');
         if(class_exists("SoapClient"))
            array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_TEST_PASSWORD');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_STATUS');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_CURRENCY');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_ORDER_STATUS_ID');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_ALLOWED');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_ZONE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SORT_ORDER');
         
         // OBSOLETE
         #array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_XMLDIR');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_ERROR_PAGE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_LOGOSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PAGEHEADERSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PAGECAPTIONSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PAGESTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCHEADERSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCCAPTIONSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCNUMBERSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCDESCRIPTIONSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCQUANTITYSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCPRICESTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCITEMEVENSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCITEMODDSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSHSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SHIPPINGCOSTSSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_TAXHSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_TAXSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADER');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PRICEHEADERSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PRICESTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_SCHEADERSTYLE');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PTYPESFORWMBI');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_AMEX');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_DINERS');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_JCB');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_MASTERCARD');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_VISA');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_MAESTRO');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_EPS');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_EPSTYPES');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_GIROPAY');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PSC');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_PB');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_QUICK');
         array_push($attributes, 'MODULE_PAYMENT_MPAY24_SELECT_ELV');
         return $attributes;
      }
      
      var $request;
   }
?>